<template>
  <div>
    <div class="title">
      <span>结算设置</span>
    </div>
    <div id="prompt">
      <p>结算日期=订单核销日期+结算周期</p>
    </div>
    <div>
      <span>结算周期（天）</span>
      <el-input v-model="input" clearable></el-input>
    </div>
    <div id="save">
      <el-button type="primary" plain @click="updataT">保存</el-button>
    </div>

  </div>
</template>

<script>
import qs from "qs"
export default {
  name: 'Settlement',
  data() {
    return {
      input: ''
    }
  },
  methods: {
    // 点击查询
    updataT() {
      this.input = Number(this.input)
      console.log("查询的值", this.input);
      // 发起请求
      this.$axios({
        url: "http://172.16.113.134:8080/finance/updateT",
        method: "post",
        data: qs.stringify({
          t: this.input
        }),
      }).then((res) => {
        console.log(res);
        if (res == true) {
          this.$message({
            type: "success",
            message: "修改成功!",
          });
          this.input = ''
        } else {
          this.$message({
            type: "error",
            message: "修改失败!",
          });
        }
      }).catch((err) => {
        console.log(err);
      });
    },
  },
  computed: {},
  watch: {},
  created() { },
  mounted() { },
}
</script>
    
<style scoped lang='less'>
.title {
  width: 70px;
  height: 20px;
  padding-left: 10px;
  border-left: 4px solid #0082cc;
  font-size: 14px;
  margin-bottom: 20px;
}

#prompt {
  margin-top: 30px;
  color: #C0C0C0;
  font-size: 14px;
  margin-bottom: 30px;
}

.el-input--suffix {
  width: 300px;
  margin-left: 30px;
}

.el-input__inner {
  width: 300px;
}

#save {
  width: 400px;
  margin-top: 30px;
  margin-left: 140px;
}

.el-button--primary.is-plain {
  width: 120px;
}
</style>